package com.Aug.dao;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Properties;

public class TestDao {

    public static void main(String[] args) throws NamingException, SQLException, IOException {
        DataSource ds = InitialContext.doLookup("java:comp/env/jndi_name");
        Connection conn = ds.getConnection();
        Properties props = conn.getClientInfo();
        System.out.println(props.toString());

//        System.out.println(System.getProperty("user.dir"));



//
//        Context initCtx = new InitialContext();
//        Context ctx = (Context) initCtx.lookup("java:comp/env/jndi_name");
////        Object obj = (Object) ctx.lookup("dataSource/mysql/prod");
//        DataSource ds = (javax.sql.DataSource)ctx;
//
//        Connection connection = ds.getConnection();
//        System.out.println(connection);


    }
}
